package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);
/*        String line = "阳光下的泡沫，是彩色的，就像被骗的我，是幸福的。";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        line = "微微笑";
        fos.write(line.getBytes(StandardCharsets.UTF_8));*/

        fos.write("爱你孤身走暗巷".getBytes(StandardCharsets.UTF_8));
        fos.write("爸爸妈妈给我的太多，教会我".getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完毕");
        fos.close();
    }
}
